﻿import QtQuick 2.0
import QtMultimedia 5.12

Item {

    property string cameraId_1: "-1"
    property string cameraId_2: "-1"
    property string cameraId_3: "-1"
    property string cameraId_4: "-1"



    // 延时自动连接相机
    Timer{
        id: timer
        repeat: false
        interval: 3000
        onTriggered: {
            var cameraList = QtMultimedia.availableCameras
            if(cameraList.length >= 2){
                console.log(cameraList[1].deviceId)
                console.log(cameraList[1].displayName)
                cameraId_4 = cameraList[1].deviceId
            }
        }
    }

    Component.onCompleted: {
        timer.start()
    }

}
